home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15342 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  970 b 

  1. Path: news1.intercall.com!usenet
  2. From: engevar@intercall.com (Steven Ovits)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Pointer to Functions and Calls thereof??
  5. Date: Thu, 18 Apr 1996 18:40:01 GMT
  6. Organization: Intercall Inc.
  7. Message-ID: <4l5p15$sl0@news1.intercall.com>
  8. References: <Dq01Ft.Dqn@latcs1.lat.oz.au> <4l2tlmINN822@keats.ugrad.cs.ubc.ca>
  9. NNTP-Posting-Host: ts3-144.intercall.com
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku) wrote:
  13.  
  14. > In article <Dq01Ft.Dqn@latcs1.lat.oz.au>,
  15. >>    {    void    *a[1];
  16. [snip]
  17. > Secondly, when you declare an array  TYPE a[1], you may only access elements
  18. > a[0] and a[1]. Accessing element a[2] is not allowed. The C Standard calls it
  19. > undefined behavior.
  20. > By the way, if you want an array of two functions, you can declare this:
  21. >    void (* funarray[3])(void);
  22.  
  23. The definition TYPE a[1] has only 1 object of type TYPE named a[0].
  24. Similarly, void (*funarray[3])(void) is an array of 3 function
  25. pointers.
  26.  
  27.  
  28.